<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('课程统计')" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <li class="select-list">
                        <ul>
                            <li>
                                <label>排课名称：</label>
                                <select class="form-control" name="id" th:with="type=${@course.courseMList()}">
                                    <option th:each="item : ${type}" th:text="${item.name}" th:value="${item.id}"></option>
                                </select>
                            </li>

                            <li>
                                <label>教师：</label>
                                <select name="teacherId" id="teacherId" class="form-control">
                                    <option value="">所有</option>
                                    <option th:each="c : ${pList}" th:text="${c.userName}" th:value="${c.userId}"></option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label>开始时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
                            </li>
                            <div class="row"></div>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()">
                                    <i class="fa fa-download"></i> 导出
                                </a>
                            </li>
                        </ul>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: select2-js" />
     <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var prefix = ctx + "school/courseConfig";
        $(function() {
            var options = {
                url: prefix + "/countStatics",
                exportUrl: prefix + "/countStatics/export",
                modalName: "排课统计",
                columns: [
                {
                    field: 'teacherId',
                    title: '教师Id',
                    visible: false
                },
                {
                    field: 'name',
                    title: '教师名称'
                },
                {
                    field: 'total',
                    title: '上课总数'
                },
                {
                    field: 'baseCount',
                    title: '排课数',
                    visible:false
                },
                {
                    field: 'disCount',
                    title: '调课数(-)'
                },
                {
                    field: 'otherCount',
                    title: '替课数(+)'
                }]
            };
            $.table.init(options);
        });

    </script>
</body>
</html>